Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create badge component #2919

Merged
merged 9 commits into from
Dec 4, 2024
Merged

Conversation

nebby2105
Copy link
Contributor

@nebby2105 nebby2105 commented Dec 1, 2024

Created Badge component #2861

Props:

  • variant: Determines the badge style (sm or lg).
  • color: Supports primary, success, and error colors (default: primary).
  • isVisible: Controls visibility of the badge (default: true).
  • badgeContent: Numeric or textual content (applies to lg variant).
  • maxContent: Specifies the maximum number to display, e.g., 99+ (default: 10).
  • isZeroShown: Toggles visibility of 0 content for the lg variant (default:false).

Examples:

  • variant ='lg'
  • badgeContent='7'
  • rest props by default
Screenshot 2024-12-01 at 23 05 40
  • variant = 'sm'
Screenshot 2024-12-01 at 23 05 48
  • color = 'success'
Screenshot 2024-12-01 at 23 05 52
  • color='error'
Screenshot 2024-12-01 at 23 06 04
  • variant ='lg'
  • color ='success'
  • maxContent ='99'
Screenshot 2024-12-01 at 23 06 20
  • variant ='lg'
  • badgeContent='7'
  • color = 'error'
Screenshot 2024-12-01 at 23 06 24
  • variant ='lg'
  • badgeContent='0'
  • isZeroShown
Screenshot 2024-12-01 at 23 06 39
  • Implemented Badge component.
  • Added prop types and default values.
  • Integrated component into Storybook with examples.
  • Verified rendering and behavior through unit tests.

@nebby2105 nebby2105 added the design system task related to scss design system label Dec 1, 2024
@nebby2105 nebby2105 self-assigned this Dec 1, 2024
@nebby2105 nebby2105 changed the title create badge component #2861 create badge component Dec 1, 2024
@nebby2105 nebby2105 linked an issue Dec 1, 2024 that may be closed by this pull request
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@ShadowOfTheSpace ShadowOfTheSpace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just renaming)
You can keep names of variables like in props without any conflict. It would be much better and readable

src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
src/design-system/components/badge/Badge.tsx Outdated Show resolved Hide resolved
@nebby2105 nebby2105 merged commit dea0776 into develop Dec 4, 2024
10 checks passed
@nebby2105 nebby2105 deleted the feature/2861/create-badge-component branch December 4, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design system task related to scss design system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(SP: 2) Create Badge component aligned with design system
4 participants